<table class="table table-bordered">
    <thead>
        <tr>
            <th>id</th>
            <th>广告标题</th>
            <th>标题</th>
            <th>广告类型</th>
            <th>链接</th>
            <th>排序字段</th>
            <th>添加时间</th>
            <th>更新时间</th>
            <th>操作</th>
        </tr>
    </thead>
    <tbody>
        <% let {advList,totalPage,pageIndex} = data %>
        <% for(let i=0;i < advList.length;i++){ %>
        <tr>
            <td><%= i+1 %></td>
            <td><%= advList[i].advTitle %></td>
            <td><img src="http://127.0.0.1:7000/upload/<%= advList[i].advPic %>" alt=""></td>
            <td><%= ADVTYPE[advList[i].advType] %></td>
            <td><%= advList[i].advHref %></td>
            <td><%= advList[i].advOrder %></td>
            <td><%= advList[i].addTime %></td>
            <td><%= advList[i].updateTime %></td>
            <td>
                <button class="btn btn-danger btn-sm success editBtn" data-id="<%= advList[i]._id %>">编辑</button>
                <button class="btn btn-danger btn-sm deleteBtn">删除</button>
            </td>
        </tr>
        <% } %>
    </tbody>
</table>

<div class="card-footer clearfix">
    <ul class="pagination pagination-sm m-0 float-right">
        <li class="page-item" data-page-index="1"><a class="page-link" href="javascript:;"">«</a></li>
        <% for(let i = 1;i <= totalPage;i++){ %>
        <li data-page-index="<%= i %>" class="page-item"><a class="page-link <%= i == pageIndex?'active':''%>" href="javascript:;"><%= i %></a></li>
        <% } %>
        <li class="page-item" data-page-index="<%= totalPage %>"><a class="page-link" href="javascript:;">»</a></li>
    </ul>
</div>